/* 
 * Copyright (C) 2012 UTSChedule
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package utsc.apps.utschedule.classes;

import android.text.TextUtils;

/**
 * This class is representing a temporary holder when we are calculating the GPA on the fly.
 * We basically only need the name, the mark(grade), and the weight of the course.
 * @author 
 *
 */
public class CourseMark {
	
	private String _name;
	private Double _mark;
	private int _position;
	private Double _weight=0.5;
	
	public String get_name() {
		return _name;
	}
	public void set_name(String _name) {
		this._name = _name;
	}
	public Double get_mark() {
		return _mark;
	}
	public void set_mark(Double _mark) {
		this._mark = _mark;
	}
	
	public CourseMark() {
		this(null, 0.0);
	}
	
	public CourseMark(String _name, Double _mark) {
		this(_name,_mark,0);
	}
	
	public CourseMark(String _name, Double _mark, int _position) {
		this(_name, _mark, _position, 0.5);
	}
	
	public CourseMark(String _name, Double _mark, int _position, Double _weight) {
		super();
		this._name = _name;
		this._mark = _mark;
		this._position = _position;
		this.set_weight(_weight);
	}
	@Override
	public String toString() {
		if (TextUtils.isEmpty(_name)) {
			return "Temp course";
		}
		return _name;
	}
	public int get_position() {
		return _position;
	}
	
	public void set_position(int _position) {
		this._position = _position;
	}
	public Double get_weight() {
		return _weight;
	}
	public void set_weight(Double _weight) {
		this._weight = _weight;
	}
}
